<style lang="less">
    @import '../../styles/common.less';
    @import '../tables/components/table.less';
</style>
<template>
    <div>
        <form action="" style="margin: 5px 0;height: 40px;">
            <!--<Input v-model="name"  placeholder="根据用户名查找" style="width: 200px;margin-right: 3px;"></Input>-->
            <!--<Input v-model="phone" placeholder="根据手机号查找" style="width: 200px"></Input>-->
            <div style="float: right">
            <a class="asd aasd" href="http://47.89.21.32:8080/ExcelExport/getOreRepord" style="float: right;margin-right: 5px" >下载报表</a>
            </div>
        </form>
        <Table :loading="loading" refs="table1"  :data="Message" :columns="columnsList"></Table>
        <!--<Page :total="pageNum" :page-size="10"  style="text-align: center;margin-top: 15px;"  @on-change="pageChange"></Page>-->

    </div>
</template>
<script>
    import $http from '../../utils/axiosWrap'
    import canEditTable from '../tables/components/canEditTable.vue'
    export default {
        data() {
            return {
                loading: true,
                Message:[],
                columnsList: [
                    {
                        title: '购买矿机V1',
                        align: 'center',
                        key: 'oreLevelIdV1'
                    },
                    {
                        title: 'AITC数量',
                        align: 'center',
                        key: 'aitcV1',
                        editable: true
                    },
                    {
                        title: '矿石数量',
                        align: 'center',
                        key: 'oreV1',
                        editable: true
                    },
                    {
                        title: '购买矿机V2',
                        align: 'center',
                        key: 'oreLevelIdV2'
                    },
                    {
                        title: 'AITC数量',
                        align: 'center',
                        key: 'aitcV2',
                        editable: true
                    },
                    {
                        title: '矿石数量',
                        align: 'center',
                        key: 'oreV2',
                        editable: true
                    },
                    {
                        title: '购买矿机V3',
                        align: 'center',
                        key: 'oreLevelIdV3'
                    },
                    {
                        title: 'AITC数量',
                        align: 'center',
                        key: 'aitcV3',
                        editable: true
                    },
                    {
                        title: '矿石数量',
                        align: 'center',
                        key: 'oreV3',
                        editable: true
                    },
                    {
                        title: '购买矿机V4',
                        align: 'center',
                        key: 'oreLevelIdV4'
                    },
                    {
                        title: 'AITC数量',
                        align: 'center',
                        key: 'aitcV4',
                        editable: true
                    },
                    {
                        title: '矿石数量',
                        align: 'center',
                        key: 'oreV4',
                        editable: true
                    },
                    {
                        title: '购买矿机V5',
                        align: 'center',
                        key: 'oreLevelIdV5'
                    },
                    {
                        title: 'AITC数量',
                        align: 'center',
                        key: 'aitcV5',
                        editable: true
                    },
                    {
                        title: '矿石数量',
                        align: 'center',
                        key: 'oreV5',
                        editable: true
                    },
                    {
                        title: '购买矿机V6',
                        align: 'center',
                        key: 'oreLevelIdV6'
                    },
                    {
                        title: 'AITC数量',
                        align: 'center',
                        key: 'aitcV6',
                        editable: true
                    },
                    {
                        title: '矿石数量',
                        align: 'center',
                        key: 'oreV6',
                        editable: true
                    },
                    {
                        title: 'AITC总计',
                        align: 'center',
                        key: 'aitcTotal',
                        editable: true
                    },
                    {
                        title: '矿石总计',
                        align: 'center',
                        key: 'oreTotal',
                        editable: true
                    },
                    {
                        title: '日期',
                        align: 'center',
                        width: 80,
                        render: (h, params) => {
                            return params.row.createTime.replace(/\T/g, ' ').substring(0,19)
                        }
                    }


                ]
            }
        },
        created: function () {
            this.load()
        },
        methods: {
            load (){
                let _this = this
                let params = new URLSearchParams()
                $http.post('/backgroundBuyOreLog/findSysOreTaday',params).then(function (res) {
                    if(res.suc){
                    _this.Message = res.result
                    _this.loading = false
                }else{
                    if(res.msg == "请先登录"){
                        _this.$Message.error('请重新登录！');
                    }else{
                        _this.$Message.error(res.msg);
                    }
                }
                })
            },
            bbxz (){
                $http.get('/ExcelExport/getOreRepord').then(function (res) {})
            }
        }
    }
</script>
<style>
    .ivu-form-item {
        margin-bottom: 5px;
    }
    .asd {
        display: inline-block;
        margin-bottom: 0;
        font-weight: 400;
        text-align: center;
        vertical-align: middle;
        -ms-touch-action: manipulation;
        touch-action: manipulation;
        cursor: pointer;
        background-image: none;
        border: 1px solid transparent;
        white-space: nowrap;
        line-height: 1.5;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        padding: 6px 15px;
        font-size: 12px;
        border-radius: 4px;
        transition: color .2s linear,background-color .2s linear,border .2s linear;
    }
    .aasd {
        color: #fff;
        background-color: #2db7f5;
        border-color: #2db7f5;
    }
    .asd :hover{
        color: #fff !important;
    }
    a:hover{
        color: #fff !important;
    }
</style>

